package com.example.client;

import com.example.common.dto.LoginDto;
import com.example.common.dto.PageDto;
import com.example.common.vo.PageVo;
import com.example.common.vo.Result;
import com.example.entity.dto.StudentDto;
import com.example.entity.vo.StudentVo;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

//@FeignClient(name = "student")
@FeignClient(name = "student", url = "http://localhost:8083")
public interface StudentClient {

    @GetMapping("/student/{studentId}")
    Result<StudentVo> getStudentById(@PathVariable String studentId);

    @PostMapping("/student")
    Result<Boolean> addStudent(@RequestBody StudentDto student);

    @DeleteMapping("/student/{studentId}")
    Result<Boolean> deleteStudentById(@PathVariable String studentId);

    @PutMapping("/student")
    Result<Boolean> updateStudent(@RequestBody StudentDto studentDto);

    @PostMapping("/student/page")
    Result<PageVo<StudentVo>> getStudentPage(@RequestBody PageDto<StudentDto> pageDto);

    @PostMapping("/student/login")
    Result<Integer> login(@RequestBody LoginDto loginDto);

}
